package secondriver.springsubway.demo.job;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;

public class MyJob3 {

	public void job() {
		System.out.println(this.getClass().getCanonicalName()
				+ " job execution threadId=" + Thread.currentThread().getId());
	}

	@Async(value = "executor")
	@Scheduled(initialDelay = 1000, fixedDelay = 1000)
	public void jobByAsync() {
		System.out.println(this.getClass().getCanonicalName()
				+ " jobByAsync execution threadId=" + Thread.currentThread().getId());
	}

	@Scheduled(cron = "*/3 * * * * ?")
	public void jobByScheduled() {
		System.out.println(this.getClass().getCanonicalName()
				+ " jobByScheduled execution threadId=" + Thread.currentThread().getId());
	}
}
